package com.manor.main.dialog

import android.content.Context
import com.lxj.xpopup.core.AttachPopupView
import com.lxj.xpopup.util.XPopupUtils
import com.manor.main.R
import kotlinx.android.synthetic.main.custom_attach_popup.view.*
import kotlin.math.roundToInt

/**
 * Description:
 * Create by lxj, at 2019/3/13
 */
class CustomAttachPopup(context: Context,val content :String ) : AttachPopupView(context) {

    override fun getImplLayoutId(): Int {
        return R.layout.custom_attach_popup
    }

    override fun onCreate() {
        super.onCreate()
        tvContent.text = content

    }

//    override fun getPopupBackground(): Drawable {
//        return DrawableCreator.Builder()
//                .setCornersRadius(DpUtil.dp2px(22).toFloat())
//                .setSolidColor(Color.parseColor("#ffffff"))
//                .build()
//    }

    override fun getMaxWidth(): Int {
        return (XPopupUtils.getWindowWidth(context)*0.85).roundToInt()
    }
}